<!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->

<Window x:Class="TextureSwap.TexturizerDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="TexturizerDemo" Height="800" Width="900"
    xmlns:Controls="clr-namespace:Microsoft.WindowsAPICodePack.DirectX.Controls;assembly=Microsoft.WindowsAPICodePack.DirectX.Controls"
    xmlns:WindowsAPICodePackPresentation="clr-namespace:Microsoft.WindowsAPICodePack.Controls.WindowsPresentationFoundation;assembly=Microsoft.WindowsAPICodePack.Shell"
        >
    <Window.Resources>
        <DataTemplate x:Key="PartTemplate">
            <StackPanel Margin="5,2,5,2" Orientation="Horizontal" >
                <TextBlock Background="Transparent" FontSize="18" Margin="4" VerticalAlignment="Center" Text="{Binding name}" />
            </StackPanel>
        </DataTemplate>

    </Window.Resources>
    <Grid Background="Aqua">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300"></ColumnDefinition>
            <ColumnDefinition Width="400*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0" Background="AliceBlue">
            <Grid.RowDefinitions>
                <RowDefinition Height="100" >
                </RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="100"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="27"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Label Grid.Row="0">Model Parts</Label>
                <Border Margin="5" BorderBrush="Black" BorderThickness="3" Grid.Row="1">
                    <ListBox Name="PartsList" SelectionChanged="PartsList_SelectionChanged" />
                </Border>
            </Grid>
            <Grid Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="27"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Label Grid.Row="0">Images</Label>
                <Border Margin="5" BorderBrush="Black" BorderThickness="3" Grid.Row="1">
                    <WindowsAPICodePackPresentation:ExplorerBrowser
                        x:Name="TextureBrowser"
                        AlwaysNavigate="True"
                        ThumbnailSize="30"
                        HideFileNames="True"/>
                </Border>
            </Grid>
            <Grid Grid.Row="2">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Button Grid.Row="0" HorizontalAlignment="Left" Margin="5" Width="160" Click="Button_Click">Swap Texture</Button>
                <CheckBox Grid.Row="1" HorizontalAlignment="Left" Margin="5" Name="ShowOneTextureCheck"  VerticalAlignment="Center" Click="ShowOneTexture_Click">Show one texture at a time.</CheckBox>
                <Button Grid.Row="2" HorizontalAlignment="Left" Margin="5" Width="160" Click="RevertTextures_Click">Revert Textures</Button>
            </Grid>
        </Grid>
        <Grid Grid.Column="1" Background="LightSteelBlue">
            <Grid.RowDefinitions>
                <RowDefinition Height="40px"/>
                <RowDefinition />
                <RowDefinition  Height="40px"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40px"/>
                <ColumnDefinition />
                <ColumnDefinition Width="40px"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Row="1" Grid.Column ="1" Margin="2" BorderBrush="Black" BorderThickness="3" Name="ControlHostElement">
                <Controls:RenderHost x:Name="renderHost"/>
            </Border>
            <Slider Grid.Column="0" Grid.Row="1" Name="XAxisSlider" Orientation="Vertical" Minimum="-180" Maximum="180" TickPlacement="BottomRight" TickFrequency="10" />
            <Slider Grid.Column="1" Grid.Row="2" Name="YAxisSlider" TickPlacement="TopLeft" TickFrequency="10" Minimum="-180" Maximum="180" />
            <Slider Grid.Column="1" Grid.Row="0" Name="ZoomSlider" Minimum="0.1" TickPlacement="BottomRight" Value="1" />
            <Slider Grid.Column="2" Grid.Row="1" Name="ZAxisSlider" Orientation="Vertical" Maximum="180" Minimum="-180" TickFrequency="10" TickPlacement="TopLeft" />
        </Grid>
    </Grid>
</Window>
